In a communications system, application services on a network device, especially on a core network device such as a router, a switch, and a gateway, continuously increase. As shown in FIG. 1, at an application layer (a service layer), multiple types of services are generally deployed, for example, a uniform resource locator filter (Uniform Resource Locator Filter, URLF), a WAN optimization controller (WOC), an application delivery controller (ADC), a security service such as an intrusion prevention system (IPS), a distributed denial of service (DDOS), and an firewall (FW), as well as bandwidth control, and quality of service (QoS) control. Execution of each service depends on specific processing by a data processing layer on network data, for example, a deep packet inspection (DPI), a secure sockets layer (SSL), and Lempel-Ziv (LZ) compression. Different services have different requirements on a data processing manner and a time sequence. The purpose of service scheduling is to meet different service requirements, perform reasonable scheduling, and avoid repeated scheduling and over-scheduling.
In the prior art, a service-based scheduling manner is generally adopted. In this scheduling manner, each service is executed separately, and meanwhile some universal functions (for example, IP fragmentation processing) are encapsulated into a data processing module; and each processing module is directly invoked when necessary. A service execution sequence is generally preset according to a service requirement of a user. When a device receives a packet, the device sends the packet to each service for processing according to the sequence. When a service needs to perform specific processing on the packet, the service invokes a related processing module according to logic of the service to perform processing. As shown in FIG. 2, assuming that a device is configured with an IPS service and an ADC service, when a packet is processed, the IPS service separately invokes a DPI module and an LZ module according to a requirement, while the ADC service invokes the DPI module, the LZ module, and an SSL module.
According to the foregoing process description, the scheduling manner in the prior art has the following two problems: The first problem is that a service execution sequence is fixed and lack of flexibility, and the second problem is that a same processing module is invoked for multiple times and a case that a packet is processed repeatedly exists, which affects the service execution efficiency.